﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- 
    *****************************************************************
    GroupBox Theme 
    *****************************************************************
    -->
    <Style TargetType="{x:Type GroupBox}">
        <Setter Property="BorderBrush" Value="#E1000000"/>
        <Setter Property="BorderThickness" Value="1,0,0,0"/>
        <Setter Property="Padding" Value="20,5,5,5"/>
        <!--Value="20,5,20,5"-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GroupBox}">
                    <Grid SnapsToDevicePixels="true" Margin="{TemplateBinding Margin}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>


                        <ContentControl FontWeight="Heavy" FontSize="14" Foreground="#E1000000" x:Name="PART_Header" >
                            <ContentPresenter ContentSource="Header" RecognizesAccessKey="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="0,10,0,5"/>
                        </ContentControl>


                        <Border Grid.Row="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Padding="{TemplateBinding Padding}" ><!--Padding="20,0,20,0"-->
                            <ContentPresenter  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /><!--Margin="{TemplateBinding Padding}"-->
                        </Border>

                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="Header" Value="{x:Null}">
                            <Setter TargetName="PART_Header" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!-- 
    *****************************************************************
    RadioButton Theme 
    *****************************************************************
    -->
    <Style TargetType="{x:Type RadioButton}">
        <Setter Property="Margin" Value="2"/>
    </Style>

    <!-- 
    *****************************************************************
    ListBox Theme 
    *****************************************************************
    -->
    <Style TargetType="{x:Type ListBox}">
        <Setter Property="Margin" Value="1,1,1,1"/>
        <Setter Property="Foreground" Value="#E1000000"/>
        <Setter Property="FontWeight" Value="Heavy"/>
        <!--<Setter Property="BorderBrush" Value="#E1000000"/>-->
        <Setter Property="BorderBrush" Value="#FF888888"/>
        <Setter Property="BorderThickness" Value="0"/>
        <!--<Setter Property="BorderThickness" Value="0,0,1,0"/>-->
        <Setter Property="Background" Value="Transparent"/>

        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="BorderBrush" Value="#60000000"/>
                <Setter Property="Background" Value="Transparent"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <!-- 
    *****************************************************************
    ListBoxItem Theme 
    *****************************************************************
    -->
    <Style TargetType="ListBoxItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="Border"  SnapsToDevicePixels="true" Margin="0,0,0,1"><!--Padding="1"-->
                        <Border Background="Transparent" Padding="1">
                            <ContentPresenter />
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#30000000"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver"  Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#10000000"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    *****************************************************************
    CheckBox Theme 
    *****************************************************************
    -->
    <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Border x:Name="Border" Width="13" Height="13" CornerRadius="0" Background="{TemplateBinding Background}" BorderThickness="1" BorderBrush="#E1000000">
                                <!--<Border x:Name="InnerBorder" Margin="2" Background="{StaticResource NormalBrush}" BorderBrush="{StaticResource LightBorderBrush}">-->
                                    <Path Width="7" Height="7" x:Name="CheckMark" SnapsToDevicePixels="False" Stroke="#E1000000" StrokeThickness="2" Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                                <!--</Border>-->
                            </Border>
                        </BulletDecorator.Bullet>
                        <ContentPresenter Margin="4,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                        </Trigger>

                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="Goldenrod" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <!--<Setter TargetName="InnerBorder" Property="Background" Value="{StaticResource CustomDarkBrush}" />-->
                            <Setter TargetName="Border" Property="BorderBrush" Value="Goldenrod"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <!--<Setter TargetName="InnerBorder" Property="Background" Value="{StaticResource PressedBrush}" />-->
                            <Setter TargetName="Border" Property="BorderBrush" Value="Goldenrod" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <!--<Setter TargetName="Border" Property="Background" Value="#80000000" />-->
                            <!--<Setter TargetName="InnerBorder" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />-->
                            <Setter TargetName="Border" Property="BorderBrush" Value="#80000000" />
                            <Setter Property="Foreground" Value="#80000000"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>